package com.cxso.example.client;

import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.sign.*;
import com.cxso.example.response.sign.*;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "电子签章")
public class SignClient extends Client {

    public SignClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "合同下载")
    public Result<SignDownloadResponse> download(SignDownloadRequest signDownloadRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateDownloadContract", HttpMethod.POST, signDownloadRequest).toEntity(SignDownloadResponse.class);
    }

    @Schema(description = "添加模板")
    public Result<SignAddHtmlTemplateResponse> addHtmlTemplate(SignAddHtmlTemplateRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateAddHtmlTemplate", HttpMethod.POST, req).toEntity(SignAddHtmlTemplateResponse.class);
    }

    @Schema(description = "根据模板生成合同文档")
    public Result<SignTemplateCreateContractResponse> templateCreateContract(SignTemplateCreateContractRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateTemplateCreateContract", HttpMethod.POST, req).toEntity(SignTemplateCreateContractResponse.class);
    }

    @Schema(description = "申请CA证书")
    public Result<SignApplyCertResponse> applyCert(SignApplyCertRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateApplyCert", HttpMethod.POST, req).toEntity(SignApplyCertResponse.class);
    }

    @Schema(description = "自动签署合同")
    public Result<SignAutoSignResponse> autoSign(SignAutoSignRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateAutoSign", HttpMethod.POST, req).toEntity(SignAutoSignResponse.class);
    }

    @Schema(description = "添加签名/签章")
    public Result<SignAddSignResponse> addSign(SignAddSignRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateAddSign", HttpMethod.POST, req).toEntity(SignAddSignResponse.class);
    }

    @Schema(description = "生成企业章")
    public Result<SignCreateSealResponse> createSeal(SignCreateSealRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateCreateSeal", HttpMethod.POST, req).toEntity(SignCreateSealResponse.class);
    }

    @Schema(description = "生成姓名矩形章")
    public Result<SignCreateSignResponse> createSign(SignCreateSignRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateCreateSign", HttpMethod.POST, req).toEntity(SignCreateSignResponse.class);
    }

    @Schema(description = "获取手写签字")
    public Result<SignHandWritingResponse> handWriting(SignHandWritingRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateHandWriting", HttpMethod.POST, req).toEntity(SignHandWritingResponse.class);
    }

    @Schema(description = "关键字签章")
    public Result<SignSealByKeywordResponse> sealByKeyword(SignSealByKeywordRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateSealByKeyword", HttpMethod.POST, req).toEntity(SignSealByKeywordResponse.class);
    }

    @Schema(description = "手机解绑")
    public Result<SignUnbindMobileResponse> unbindMobile(SignUnbindMobileRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateUnbindMobile", HttpMethod.POST, req).toEntity(SignUnbindMobileResponse.class);
    }

    @Schema(description = "添加pdf模板")
    public Result<SignAddPdfTemplateResponse> addPdfTemplate(SignAddPdfTemplateRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateAddPdfTemplate", HttpMethod.POST, req).toEntity(SignAddPdfTemplateResponse.class);
    }

    @Schema(description = "虚拟手机号申请CA证书")
    public Result<SignApplyCertStringResponse> applyCertString(SignApplyCertStringRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateApplyCertString", HttpMethod.POST, req).toEntity(SignApplyCertStringResponse.class);
    }

    @Schema(description = "pdf模板添加组件")
    public Result<SignAddComponentsResponse> addComponents(SignAddComponentsRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateAddComponents", HttpMethod.POST, req).toEntity(SignAddComponentsResponse.class);
    }

    @Schema(description = "pdf模板和组件生成合同")
    public Result<SignCreateByTemplateComponentsResponse> createByTemplateComponents(SignCreateByTemplateComponentsRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateCreateByTemplateComponents", HttpMethod.POST, req).toEntity(SignCreateByTemplateComponentsResponse.class);
    }

    @Schema(description = "合同签署-骑缝章/多页签")
    public Result<SignMultipleSealResponse> multipleSeal(SignMultipleSealRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateMultipleSeal", HttpMethod.POST, req).toEntity(SignMultipleSealResponse.class);
    }

    @Schema(description = "合同签署-坐标字签带日期")
    public Result<SignAutoSignDateImageResponse> autoSignDateImage(SignAutoSignDateImageRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateAutoSignDateImage", HttpMethod.POST, req).toEntity(SignAutoSignDateImageResponse.class);
    }

    @Schema(description = "合同管理-上传文件创建合同")
    public Result<SignUploadFileCreateContractResponse> uploadFileCreateContract(SignUploadFileCreateContractRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateUploadFileCreateContract", HttpMethod.POST, req).toEntity(SignUploadFileCreateContractResponse.class);
    }

    @Schema(description = "个人身份证三要素")
    public Result<SignThreeElementsIdentificationResponse> threeElementsIdentification(SignThreeElementsIdentificationRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateThreeElementsIdentification", HttpMethod.POST, req).toEntity(SignThreeElementsIdentificationResponse.class);
    }

    @Schema(description = "查询用户证书详情")
    public Result<SignGetCertInfoResponse> getCertInfo(SignGetCertInfoRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateGetCertInfo", HttpMethod.POST, req).toEntity(SignGetCertInfoResponse.class);
    }

    @Schema(description = "个人身份证二要素")
    public Result<SignIdentityAuthUrlResponse> identityAuthUrl(SignIdentityAuthUrlRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateIdentityAuthUrl", HttpMethod.POST, req).toEntity(SignIdentityAuthUrlResponse.class);
    }

    @Schema(description = "获取模板详情")
    public Result<SignGetTemplateDetailResponse> getTemplateDetail(SignGetTemplateDetailRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateGetTemplateDetail", HttpMethod.POST, req).toEntity(SignGetTemplateDetailResponse.class);
    }

    @Schema(description = "获取模板文件")
    public Result<SignGetTemplateInfoResponse> ecloudGetTemplateInfo(EcloudGetTemplateInfoRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateGetTemplateInfo", HttpMethod.POST, req).toEntity(SignGetTemplateInfoResponse.class);
    }

    @Schema(description = "发送短信")
    public Result<SignSendSmsResponse> ecloudSendSms(EcloudSendSmsRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateSendSms", HttpMethod.POST, req).toEntity(SignSendSmsResponse.class);
    }

    @Schema(description = "短信签署")
    public Result<SignSmsSignResponse> ecloudSmsSign(EcloudSmsSignRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/sign/operateSmsSign", HttpMethod.POST, req).toEntity(SignSmsSignResponse.class);
    }

}
